<?xml version="1.0" encoding="UTF-8"?>
	<!-- 
  Geologic Unit mapping file
-->
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
	xmlns:ogc="http://www.opengis.net/ogc" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd
                      http://www.opengis.net/ogc http://schemas.opengis.net/filter/1.1.0/expr.xsd">
	<namespaces>
		<!--
			declare here the namespaces and prefixes used by the parser to
			resolve <type> elements.
		-->
		<Namespace>
			<prefix>gsml</prefix>
			<uri>urn:cgi:xmlns:CGI:GeoSciML:2.0</uri>
		</Namespace>
		<Namespace>
			<prefix>gml</prefix>
			<uri>http://www.opengis.net/gml</uri>
		</Namespace>
		<Namespace>
			<prefix>xlink</prefix>
			<uri>http://www.w3.org/1999/xlink</uri>
		</Namespace>
	</namespaces>
	<sourceDataStores>
		<DataStore>
			<id>GeologicUnit</id>
			<parameters>
				<Parameter>
					<name>directory</name>
					<!-- path can be relative to this file if starts with "file: -->
					<value>file:./</value>
				</Parameter>
			</parameters>
		</DataStore>
	</sourceDataStores>
	<targetTypes>
		<FeatureType>
			<schemaUri>http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd</schemaUri>
		</FeatureType>
	</targetTypes>
	<typeMappings>
		<FeatureTypeMapping>
			<sourceDataStore>GeologicUnit</sourceDataStore>
			<sourceType>GeologicUnit</sourceType>
			<targetElement>gsml:GeologicUnit</targetElement>
			<attributeMappings>
				<AttributeMapping>
					<targetAttribute>gsml:GeologicUnit</targetAttribute>
				  	<idExpression><OCQL>GML_ID</OCQL></idExpression> 
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>gml:description</targetAttribute>
					<sourceExpression>
						<OCQL>TEXTDESCRIPTION</OCQL>
					</sourceExpression>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>
			            gml:name[1]
  		            </targetAttribute>
					<sourceExpression>
						<OCQL>NAME</OCQL>
					</sourceExpression>					
					<isMultiple>true</isMultiple>
					<ClientProperty>
						<name>codeSpace</name>
						<value>'urn:ietf:rfc:2141'</value>
					</ClientProperty>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>
		                gml:name[2]
		            </targetAttribute>
					<sourceExpression>
						<OCQL>ABBREVIATION</OCQL>
					</sourceExpression>					
		            <isMultiple>true</isMultiple>
				</AttributeMapping>
				<AttributeMapping>
					<targetAttribute>
		                FEATURE_LINK
		            </targetAttribute>
					<sourceExpression>
						<OCQL>GML_ID</OCQL>
					</sourceExpression>
				</AttributeMapping>
                <AttributeMapping> 
                    <targetAttribute>gsml:observationMethod/gsml:CGI_TermValue/gsml:value</targetAttribute> 
                    <sourceExpression>
                        <OCQL>'urn:ogc:def:nil:OGC::missing'</OCQL>
                    </sourceExpression> 
                    <ClientProperty>
                        <name>codeSpace</name>
                        <value>'http://urn.opengis.net'</value>
                    </ClientProperty> 
                </AttributeMapping>
               <AttributeMapping>
                    <targetAttribute>gsml:purpose</targetAttribute>
                    <sourceExpression>
                        <OCQL>'instance'</OCQL>
                    </sourceExpression>
                </AttributeMapping>
               <AttributeMapping>
                    <targetAttribute>gsml:geologicUnitType</targetAttribute>
                    <ClientProperty>
                        <name>xlink:href</name>
                        <value>'urn:ogc:def:nil:OGC::unknown'</value>
                    </ClientProperty> 
                </AttributeMapping>
			</attributeMappings>
		</FeatureTypeMapping>
	</typeMappings>
</as:AppSchemaDataAccess>
